Helpful Information
 
 
Category: .JSP
.JSP > Flash

ok, all i want is to send information from from a flash file(embeded in a web page)- which is a .jsp page to a text file.

well i've done most of it, my problem is ive made use of .jsp code, which create the .txt file on the local drive only when a "Absolute Path" is provided...

now the only modification i need, is how to create the .txt file with a relative path, so that the application could also be used on a web server

this is what i've used for creating the .txt file >>>

fileOut = new BufferedWriter (new FileWriter ("d:\\info.txt", true));

i've tried the common conventions for the relative path like
../, // but to no avail

java gurus plz forgive me, iam a novice to .jsp :confused:

i know using a db is always good, yeh i've done the same using mySQL, but plz i also need the .txt file done :)


thank u

no point at all using a relative path the behaviour is going to be mostly unpredicatable. the better approach is to define the save path in either a property file or in the web.xml file (deployment descriptor). Eitehr way you can then customize it accoding to the installation.

How to pass in additional parameters to servlets (or jsp as the case may be) is well described in the tomcat documentation - there is even a sample you can use.

for using property files you can read up the tutorial on the java.sun.com site or the API doc for the java.util.Properties class - it's really simple.










privacy (GDPR)